Skip to content

Conversation

@bsbodden
Copy link
Collaborator

@bsbodden bsbodden commented Sep 5, 2025

No description provided.

…elds

- Created test entity with mixed field types (Integer, Double, Boolean, LocalDate)
- Added projection interfaces with and without @value annotations
- Test shows that non-String fields require @value annotation to work properly
- The workaround of using @value annotation works as expected

This test documents the behavior described in issue redis#650 where projection
interfaces return null for non-String fields unless @value annotation is used.

Related to redis#650
…annotation (redis#650)

Previously, projection interfaces returned null for non-String fields (Integer, Double,
Boolean, LocalDate, etc.) unless the @value annotation was used as a workaround. This was
due to incomplete handling of field types during projection result processing.

This fix addresses the issue in two places:
1. MappingRedisOMConverter: Added projection interface introspection to determine property
   types for proper conversion when processing hash-based repositories
2. RediSearchQuery: Enhanced parseDocumentResult() to handle both full JSON documents and
   individual fields returned during projection optimization, with proper type conversion
   for booleans (stored as 1/0), dates (stored as timestamps), and other non-String types

The framework now correctly handles all field types in projection interfaces without
requiring the @value annotation workaround.

Fixes redis#650
@bsbodden bsbodden merged commit b7963f2 into redis:main Sep 5, 2025
1 check passed
@bsbodden bsbodden deleted the bsb/issue-650 branch September 5, 2025 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant